<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'eova-icon724',plain:true" onclick="slave_${object.code}_add()">新增</a>
<script type="text/javascript">
    var slave_${object.code}_add = function () {
    	
    	// ------------------------------级联
        var ref = '';
    	var parent = $('#${parentId!}');
       	// 主对象关联字段
        var objectField = '${config.objectField!}';
        // 子对象关联字段
        var field = '${field!}';
    	if(parent && objectField != '' && field != ''){
    		// 从父组件上获取选中外键值
    		var parentRow = $.getWidgetSelected(parent);
    		ref = ref + "?ref=" + field + ":" + parentRow[objectField];
    	}
    	// ------------------------------级联
    	
    	var $grid = $('#${gridId}');
        loadDialog($grid, '新增${object.name}', '/form/add/${object.code}' + ref);
    };
</script>